package com.moli.iov.base.model;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.moli.iov.base.model.po.VehicleBaseAuth;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * The type Vehicle base auth param.
 *
 * @author wanghualin
 * @date 2020 -02-26 13:51:39
 */
public class VehicleBaseAuthParam {
    private QueryWrapper<VehicleBaseAuth> queryWrapper;

    public VehicleBaseAuthParam() {
        queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_delete", 0);
    }

    public QueryWrapper<VehicleBaseAuth> get() {
        return queryWrapper;
    }

    public VehicleBaseAuthParam queryEqVin(String vin) {
        if (!StringUtils.isEmpty(vin)) {
            queryWrapper.eq(VehicleBaseAuth.VIN, vin);
        }
        return this;
    }

    public VehicleBaseAuthParam queryInVin(List<String> vin) {
        if (!CollectionUtils.isEmpty(vin)) {
            queryWrapper.in(VehicleBaseAuth.VIN, vin);
        }
        return this;
    }

}
